package recursion

import "fmt"

func HanoiPrint(layer int){
	HanoiProcess(layer, "左", "右","中")
}

func HanoiProcess(n int, from, to, other string) {
	if n == 1 {
		fmt.Printf("move %d from %s to %s \n", n, from, to)
		return
	}
	HanoiProcess(n-1, from, other, to)
	fmt.Printf("move %d from %s to %s \n", n, from, to)
	HanoiProcess(n-1, other, to, from)
}

